﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebEx.Tool {
    public partial class Weather : System.Web.UI.Page {
        protected void Page_Load(object sender, EventArgs e) {

        }

        protected void btnCheck_Click(object sender, EventArgs e) {
            string url = "http://www.webxml.com.cn/WebServices/WeatherWebService.asmx";
            string methodName = "getWeatherbyCityName";
            object[] args = new object[1];
            args[0] = this.txtCity.Text;

            String[] str = WebServiceHelper.InvokeMethod<String[]>(url, methodName, args);
            try {
                txtRich.Text = string.Empty;
                lab1.Text = str[5];
                lab2.Text = str[12];
                lab3.Text = str[17];

                for (int i = 0; i < str.Length; i++) {
                    
                    txtRich.Text += str[i];
                }
            } catch (Exception ex) {

                throw;
            }
        }
    }
}